Every routine has an Origin Event, an event that triggers the system's execution of that routine. Additionally, the origin event of a routine controls the Context Variables accessible to the actions in the routine. Many of the types of routine actions can store objects or values as variables that are accessible to all subsequent actions in the logic chain. Context variables, however, are accessible from the very start of the logic chain. There are eight types of origin events that can trigger a routine, and each - along with the context variables it enabled - is described below.
The system executes a routine with this origin event when it receives a device message of a particular type. The below screenshot shows not only the Origin and Event menus, which allow the user to select a category and specific event type, but also the state of the Routines page once the user has selected the Device - Received Message origin event type.
If the user selects this type of event, the Routines page displays each defined device profile as a header, and allows the user to select one of the message types contained within these device profiles. In the above example, whenever the system receives a message of type "GE IP RXi - STATUS" from a device using the "Test Car GE" profile, it will trigger the routine. A routine using this type of origin event will have access to two context variables: source, the resource or group associated with the device that sent the message, and message, which is the message itself, containing all the values sent by the device. In the above example, the Test Car GE device profile links devices with the "Car" resource type, so the "source" variable is a resource of the Car type. Below the origin-event-specific details of the routine, the Routines page lists each context variable's name, what type of object it is, and the names of each of its fields (with the means of identifying those fields in EL expressions shown in brackets).
The system executes a routine with this origin event when a certain form is submitted by any user. When building a routine, the user can select the desired form from among all those defined for the current account. All routines with this type of origin event have at least one context variable, identified by the code of the selected form; this variable stores all the values submitted using the form. In the example shown in the screenshot below, the "Edit Car" form has the code "ec", so the "ec" context variable stores the values entered into each of its fields.
If any of the fields of a form reference other objects, the system exposes those objects to the routine as context variables as well using the code of the Reference field.
The system also uses forms behind the scenes when importing data from a spreadsheet, as describe in detail on the Data Import page. Like the Form - Submit origin event type, the user must also select from among the forms defined in the account. If the system experiences an error when using the selected form to import data, it will execute the routine. Routines with this origin event type have the same context variables as those with the Form - Submit trigger.
The system will execute the routine if it successfully uses the selected form to import data. Routines using this origin event type have the same context variables as those using the other form-related triggers.
The Fusion Connect platform can also run routines on a timer. The "Weekly Schedule" option allows the user to select a time of day, time zone, and any of the days of the week; the system will execute the routine on that time on each of the selected days every week. Routines using this type of origin event have no context variables.
The system repeats the following cycle: wait a predefined amount of time, then execute the routine. The user can define as an interval any whole number of minutes or hours, with a minimum of 1 minute and a maximum of 24 hours. The user can specify a certain time within the next interval length to execute the routine; in the below example, if the current time is 8:52 AM and the user selects an interval of 10 minutes, he or she can select any minute up to 9:02 AM at which the system will execute the routine. The timer then resets to the full interval length at that point, so the system will run the routine at 9:00, 9:10, 9:20, and so on. As with the Timer - Weekly Schedule origin event type, routines using this trigger have no context variables.